package cn.iocoder.yudao.module.erp.dal.mysql.business.produce.defectiveitems;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.erp.controller.admin.business.produce.defectiveitems.vo.DefectiveItemsPageReqVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.business.produce.defectiveitems.DefectiveItemsDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 不良品项 Mapper
 *
 * @author 奥特曼
 */
@Mapper
public interface DefectiveItemsMapper extends BaseMapperX<DefectiveItemsDO> {

    default PageResult<DefectiveItemsDO> selectPage(DefectiveItemsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DefectiveItemsDO>()
                .eqIfPresent(DefectiveItemsDO::getDefectCode, reqVO.getDefectCode())
                .likeIfPresent(DefectiveItemsDO::getDefectDescription, reqVO.getDefectDescription())
                .betweenIfPresent(DefectiveItemsDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DefectiveItemsDO::getId));
    }

}